package exercise4;

import java.util.Scanner;

public class Exercise10_07 {


    public static void main(String []args){

        int choice = 0;
        while (true){

            //输入id
            System.out.println("请输入你的id：");
            Scanner input=new Scanner(System.in);
            int id=input.nextInt();

            while (choice!=4){

                //创建对象
                Account ATM=new Account(id,100);

                //创建ATM界面
                print_gui();

                //读取指令
                choice=input.nextInt();

                if (choice==1){
                    System.out.println("余额为："+ATM.getBalance());
                }
                if (choice==2){
                    System.out.println("请输入取款余额：");
                    ATM.withdraw(input.nextDouble());
                }
                if (choice==3){
                    System.out.println("请输入存款余额： ");
                    ATM.deposit(input.nextDouble());
                }

            }


        }

    }
    public static void print_gui(){
        //创建ATM界面
        System.out.println("Main Menu");
        System.out.println("1.Check the balance");
        System.out.println("2.withdraw");
        System.out.println("3.deposit");
        System.out.println("4.Exit");
        System.out.println("请输入你的指令：");
    }
}
